import { VFC } from 'react';
import { RouterGuard } from 'zw-components';
export function isLogin(): Promise<boolean> {
    let result = sessionStorage.getItem('isLogin') === 'true' ? true : false;
    if(result === false) {
        // console.log(location)
        // location.href = 'https://baidu.com';
    }
    return Promise.resolve(true);
}
export const LoginAuth: VFC<{path: string, component: any}> = (props) => {
    return <RouterGuard before={isLogin} path={props.path} component={props.component}/>
}